{% extends 'base.html' %}

{% block title %}首页{% endblock %}

{% block main %}
    <h1>课程列表</h1>


    <div class="row row-cols-2 row-gap-4">
        {% for course_teach in course_teachs %}
            <div class="col">
                <div class="card">
                    <div class="card-header">
                        <a href="/detail/{{ course_teach.id }}">{{ course_teach.course }}</a>
                    </div>
                    <div class="card-body" style="height: 150px">
                        <p class="card-text">{{ course_teach.content |safe |striptags |truncatechars:200 }}</p>
                    </div>
                    <div class="card-footer text-muted d-flex justify-content-between ">
                        <div>
                            {{ course_teach.teacher.profession }}{{ course_teach.teacher.user.username }}
                        </div>
                        <div>
                            {{ course_teach.course.study_time }} 学时
                        </div>

                    </div>
                </div>
            </div>
        {% endfor %}
    </div>
{% endblock %}